package com.wlj.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wlj.dto.UserMenuDTO;
import com.wlj.dto.UserResourcesDTO;
import com.wlj.dto.UserRoleDTO;
import com.wlj.pojo.TbUser;
import org.apache.ibatis.annotations.Param;


import java.util.List;

public interface UserDao extends BaseMapper<TbUser> {

    TbUser findByUsername(String username);

    UserResourcesDTO getUserAndResources(String username);

    UserRoleDTO getUserAndRoles(String username);

    UserMenuDTO getUserAndMenus(String username);

    List<TbUser> listAllUsers();

    //每个用户必有一个角色
    List<UserRoleDTO> listUsersAndRole();

    UserRoleDTO getUserAndRoleById(Integer userId);

    void addUser(@Param("tbUser") TbUser tbUser);

    void delUserByrId(Integer userId);
}
